#include <iostream>
#include <cmath>

//对修改关闭，对扩展开放
class Point
{
public:
    Point(int x,int y):x(x),y(y){}

    static int DistanceX();

    //友元类
    friend class PointTool;
private:
    int x;
    int y;

};



class PointTool
{
public:
    static double Distance(const Point& p1, const Point &p2)
    {
        return sqrt(pow(p1.x - p2.x,2) + pow(p1.y - p2.y,2));
    }
    static void show(const Point& p)
    {
        std::cout<<p.x<<" "<<p.y<<std::endl;
    }
};

int main()
{
    Point p1(1,1);
    Point p2(2,2);

    std::cout<<PointTool::Distance(p1,p2)<<std::endl;
    return 0;
}